import request from "@/utils/request";

// 获取门禁控制
export function getEntrancetGuardSystemControlApi() {
  return request({
    url: "/cgi-bin/entry.cgi/system/entrance-guard-system-control",
    method: "get",
  });
}

// 修改门禁控制
export function editEntrancetGuardSystemControlApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/entrance-guard-system-control",
    method: "post",
    data,
  });
}

// 获得闸机信息
export function getGateControlApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/gate-control",
    method: "get",
    data,
  });
}

// 修改闸机信息
export function editGateControlApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/gate-control",
    method: "post",
    data,
  });
}

// 获取gps信息
export function getGpsInfoApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/gps-info",
    method: "get",
    data,
  });
}

// 修改gps信息
export function editGpsInfoApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/gps-info",
    method: "post",
    data,
  });
}

// 获得UI控制
export function getUIcontrolApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/ui-control",
    method: "get",
    data,
  });
}

// 修改UI控制
export function editUIcontrolApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/ui-control",
    method: "post",
    data,
  });
}

// 上传logo
export function editUILogoApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/ui-logo",
    method: "post",
    data,
  });
}

// 上传开机画面
export function editStartupLogoApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/startup-logo",
    method: "post",
    data,
  });
}

// 获得门禁密码
export function getEntranceGuardPasswordApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/get-entrance-guard-password",
    method: "post",
    data,
  });
}

// 修改门禁密码
export function editEntranceGuardPasswordApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/entrance-guard-password",
    method: "post",
    data,
  });
}

// 添加门禁密码
export function addEntranceGuardSystemControlApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/system/entrance-guard-password-add",
    method: "post",
    data,
  });
}

// 删除门禁密码
export function delEntranceGuardSystemControlApi(data) {
  return request({
    url: `/cgi-bin/entry.cgi/system/entrance-guard-password/${data}`,
    method: "DELETE",
  });
}

// 批量删除门禁密码
export function delEntranceGuardPasswordBatchApi(data) {
  return request({
    url: `/cgi-bin/entry.cgi/system/entrance-guard-password-delete-batch`,
    method: "post",
    data,
  });
}

// 全部清除门禁密码
export function delEntranceGuardPasswordResetApi(data) {
  return request({
    url: `/cgi-bin/entry.cgi/system/entrance-guard-password-reset`,
    method: "delete",
  });
}

// 修改/新增通行策略
export function addPassStrategyApi(data) {
  return request({
    url: "/cgi-bin/entry.cgi/event/pass-strategy",
    method: "post",
    data,
  });
}

// 获取详情
export function queryTrafficRuleDetails(data) {
  return request({
    url: "/cgi-bin/entry.cgi/event/pass-strategy-details",
    method: "post",
    data,
  });
}

// 获取通行策略
export function queryTrafficRule(data) {
  return request({
    url: "/cgi-bin/entry.cgi/event/pass-strategy-list",
    method: "post",
    data,
  });
}

// 删除通行策略
export function deleteTrafficRule(data) {
  return request({
    url: "/cgi-bin/entry.cgi/event/pass-strategy-delete",
    method: "post",
    data
  });
}

// 获得密码校验正则
export function getPassWordCheckRegx(params) {
  return request({
    url: "/cgi-bin/entry.cgi/system/password-regex-message",
    method: "get",
  });
}

